from celery import Celery

import os

# 创建环境
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meiduo_market.settings")

# 创建实例对象
app = Celery('celery.tasks')

# 配置文件
app.config_from_object('celery_tasks.config')

#  自动检测任务
app.autodiscover_tasks(['celery_tasks.sms','celery_tasks.email'])

# celery -A celery实例对象的文件 worker -l info

# celery -A celery_tasks.main worker -l info